{% extends '_layout.html' %}

{% block _head %}
    {% load static %}
    <script src="{% static 'js/echarts.min.js' %}"></script>
{% endblock %}

{% block main %}
    <div id="main" style="width: 80%;height:90%;"></div>
{% endblock %}

{% block script %}
    <script>
       
  var chartDom = document.getElementById('main');
  var myChart = echarts.init(chartDom);
  var option;
  const name = ['Credit_History', 'LoanAmount_log', 'ApplicantIncome_log', 'CoapplicantIncome_log', 'Loan_Amount_Term_log', 'Gender_Female', 'Gender_Male', 'Married_No', 'Married_Yes', 'Dependents_3', 'Dependents_0', 'Dependents_1', 'Dependents_2', 'Education_Graduate', 'Education_Not Graduate', 'Self_Employed_No', 'Self_Employed_Yes', 'Property_Area_Rural', 'Property_Area_Semiurban', 'Property_Area_Urban']

  const data = [
    [0, 0, 1],
    [0, 1, -0.019],
    [0, 2, 0.013],
    [0, 3, 0.008],
    [0, 4, -0.016],
    [0, 5, -0.009],
    [0, 6, 0.009],
    [0, 7, -0.011],
    [0, 8, 0.011],
    [0, 9, -0.06],
    [0, 10, 0.021],
    [0, 11, 0.01],
    [0, 12, 0.008],
    [0, 13, 0.074],
    [0, 14, -0.074],
    [0, 15, 0.002],
    [0, 16, -0.002],
    [0, 17, -0.021],
    [0, 18, 0.036],
    [0, 19, -0.017],
    [1, 0, -0.019],
    [1, 1, 1],
    [1, 2, 0.491],
    [1, 3, 0.133],
    [1, 4, 0.083],
    [1, 5, -0.143],
    [1, 6, 0.143],
    [1, 7, -0.18],
    [1, 8, 0.18],
    [1, 9, 0.124],
    [1, 10, -0.148],
    [1, 11, 0.058],
    [1, 12, 0.046],
    [1, 13, 0.146],
    [1, 14, -0.146],
    [1, 15, -0.11],
    [1, 16, 0.11],
    [1, 17, 0.079],
    [1, 18, 0.007],
    [1, 19, -0.083],
    [2, 0, 0.013],
    [2, 1, 0.491],
    [2, 2, 1],
    [2, 3, -0.368],
    [2, 4, -0.015],
    [2, 5, -0.085],
    [2, 6, 0.085],
    [2, 7, -0.021],
    [2, 8, 0.021],
    [2, 9, 0.112],
    [2, 10, -0.115],
    [2, 11, 0.072],
    [2, 12, -0.004],
    [2, 13, 0.182],
    [2, 14, -0.182],
    [2, 15, -0.19],
    [2, 16, 0.19],
    [2, 17, 0.023],
    [2, 18, 0.006],
    [2, 19, -0.028],
    [3, 0, 0.008],
    [3, 1, 0.133],
    [3, 2, -0.368],
    [3, 3, 1],
    [3, 4, 0.013],
    [3, 5, -0.221],
    [3, 6, 0.221],
    [3, 7, -0.317],
    [3, 8, 0.317],
    [3, 9, -0.061],
    [3, 10, -0.022],
    [3, 11, 0.014],
    [3, 12, 0.06],
    [3, 13, -0.043],
    [3, 14, 0.043],
    [3, 15, 0.092],
    [3, 16, -0.092],
    [3, 17, 0.057],
    [3, 18, -0.018],
    [3, 19, -0.037],
    [4, 0, -0.016],
    [4, 1, 0.083],
    [4, 2, -0.015],
    [4, 3, 0.013],
    [4, 4, 1],
    [4, 5, 0.054],
    [4, 6, -0.054],
    [4, 7, 0.068],
    [4, 8, -0.068],
    [4, 9, -0.06],
    [4, 10, 0.091],
    [4, 11, -0.074],
    [4, 12, -0.002],
    [4, 13, 0.063],
    [4, 14, -0.063],
    [4, 15, 0.026],
    [4, 16, -0.026],
    [4, 17, 0.048],
    [4, 18, 0.045],
    [4, 19, -0.093],
    [5, 0, -0.009],
    [5, 1, -0.143],
    [5, 2, -0.085],
    [5, 3, -0.221],
    [5, 4, 0.054],
    [5, 5, 1],
    [5, 6, -1],
    [5, 7, 0.365],
    [5, 8, -0.365],
    [5, 9, -0.096],
    [5, 10, 0.148],
    [5, 11, 0.004],
    [5, 12, -0.13],
    [5, 13, 0.045],
    [5, 14, -0.045],
    [5, 15, -0.001],
    [5, 16, 0.001],
    [5, 17, -0.08],
    [5, 18, 0.109],
    [5, 19, -0.035],
    [6, 0, 0.009],
    [6, 1, 0.143],
    [6, 2, 0.085],
    [6, 3, 0.221],
    [6, 4, -0.054],
    [6, 5, -1],
    [6, 6, 1],
    [6, 7, -0.365],
    [6, 8, 0.365],
    [6, 9, 0.096],
    [6, 10, -0.148],
    [6, 11, -0.004],
    [6, 12, 0.13],
    [6, 13, -0.045],
    [6, 14, 0.045],
    [6, 15, 0.001],
    [6, 16, -0.001],
    [6, 17, 0.08],
    [6, 18, -0.109],
    [6, 19, 0.035],
    [7, 0, -0.011],
    [7, 1, -0.18],
    [7, 2, -0.021],
    [7, 3, -0.317],
    [7, 4, 0.068],
    [7, 5, 0.365],
    [7, 6, -0.365],
    [7, 7, 1],
    [7, 8, -1],
    [7, 9, -0.133],
    [7, 10, 0.348],
    [7, 11, -0.114],
    [7, 12, -0.25],
    [7, 13, 0.012],
    [7, 14, -0.012],
    [7, 15, 0.004],
    [7, 16, -0.004],
    [7, 17, 0.007],
    [7, 18, -0.006],
    [7, 19, -0.001],
    [8, 0, 0.011],
    [8, 1, 0.18],
    [8, 2, 0.021],
    [8, 3, 0.317],
    [8, 4, -0.068],
    [8, 5, -0.365],
    [8, 6, 0.365],
    [8, 7, -1],
    [8, 8, 1],
    [8, 9, 0.133],
    [8, 10, -0.348],
    [8, 11, 0.114],
    [8, 12, 0.25],
    [8, 13, -0.012],
    [8, 14, 0.012],
    [8, 15, -0.004],
    [8, 16, 0.004],
    [8, 17, -0.007],
    [8, 18, 0.006],
    [8, 19, 0.001],
    [9, 0, -0.06],
    [9, 1, 0.124],
    [9, 2, 0.112],
    [9, 3, -0.061],
    [9, 4, -0.06],
    [9, 5, -0.096],
    [9, 6, 0.096],
    [9, 7, -0.133],
    [9, 8, 0.133],
    [9, 9, 1],
    [9, 10, -0.358],
    [9, 11, -0.134],
    [9, 12, -0.134],
    [9, 13, -0.055],
    [9, 14, 0.055],
    [9, 15, -0.003],
    [9, 16, 0.003],
    [9, 17, 0.041],
    [9, 18, 0.008],
    [9, 19, -0.047],
    [10, 0, 0.021],
    [10, 1, -0.148],
    [10, 2, -0.115],
    [10, 3, -0.022],
    [10, 4, 0.091],
    [10, 5, 0.148],
    [10, 6, -0.148],
    [10, 7, 0.348],
    [10, 8, -0.348],
    [10, 9, -0.358],
    [10, 10, 1],
    [10, 11, -0.531],
    [10, 12, -0.528],
    [10, 13, 0.037],
    [10, 14, -0.037],
    [10, 15, 0.088],
    [10, 16, -0.088],
    [10, 17, 0.044],
    [10, 18, -0.004],
    [10, 19, -0.038],
    [11, 0, 0.01],
    [11, 1, 0.058],
    [11, 2, 0.072],
    [11, 3, 0.014],
    [11, 4, -0.074],
    [11, 5, 0.004],
    [11, 6, -0.004],
    [11, 7, -0.114],
    [11, 8, 0.114],
    [11, 9, -0.134],
    [11, 10, -0.531],
    [11, 11, 1],
    [11, 12, -0.198],
    [11, 13, 0.013],
    [11, 14, -0.013],
    [11, 15, -0.082],
    [11, 16, 0.082],
    [11, 17, -0.084],
    [11, 18, 0.012],
    [11, 19, 0.069],
    [12, 0, 0.008],
    [12, 1, 0.046],
    [12, 2, -0.004],
    [12, 3, 0.06],
    [12, 4, -0.002],
    [12, 5, -0.13],
    [12, 6, 0.13],
    [12, 7, -0.25],
    [12, 8, 0.25],
    [12, 9, -0.134],
    [12, 10, -0.528],
    [12, 11, -0.198],
    [12, 12, 1],
    [12, 13, -0.021],
    [12, 14, 0.021],
    [12, 15, -0.032],
    [12, 16, 0.032],
    [12, 17, -0.004],
    [12, 18, -0.012],
    [12, 19, 0.017],
    [13, 0, 0.074],
    [13, 1, 0.146],
    [13, 2, 0.182],
    [13, 3, -0.043],
    [13, 4, 0.063],
    [13, 5, 0.045],
    [13, 6, -0.045],
    [13, 7, 0.012],
    [13, 8, -0.012],
    [13, 9, -0.055],
    [13, 10, 0.037],
    [13, 11, 0.013],
    [13, 12, -0.021],
    [13, 13, 1],
    [13, 14, -1],
    [13, 15, -0.01],
    [13, 16, 0.01],
    [13, 17, -0.078],
    [13, 18, 0.039],
    [13, 19, 0.034],
    [14, 0, -0.074],
    [14, 1, -0.146],
    [14, 2, -0.182],
    [14, 3, 0.043],
    [14, 4, -0.063],
    [14, 5, -0.045],
    [14, 6, 0.045],
    [14, 7, -0.012],
    [14, 8, 0.012],
    [14, 9, 0.055],
    [14, 10, -0.037],
    [14, 11, -0.013],
    [14, 12, 0.021],
    [14, 13, -1],
    [14, 14, 1],
    [14, 15, 0.01],
    [14, 16, -0.01],
    [14, 17, 0.078],
    [14, 18, -0.039],
    [14, 19, -0.034],
    [15, 0, 0.002],
    [15, 1, -0.11],
    [15, 2, -0.19],
    [15, 3, 0.092],
    [15, 4, 0.026],
    [15, 5, -0.001],
    [15, 6, 0.001],
    [15, 7, 0.004],
    [15, 8, -0.004],
    [15, 9, -0.003],
    [15, 10, 0.088],
    [15, 11, -0.082],
    [15, 12, -0.032],
    [15, 13, -0.01],
    [15, 14, 0.01],
    [15, 15, 1],
    [15, 16, -1],
    [15, 17, -0.022],
    [15, 18, -0.009],
    [15, 19, 0.03],
    [16, 0, -0.002],
    [16, 1, 0.11],
    [16, 2, 0.19],
    [16, 3, -0.092],
    [16, 4, -0.026],
    [16, 5, 0.001],
    [16, 6, -0.001],
    [16, 7, -0.004],
    [16, 8, 0.004],
    [16, 9, 0.003],
    [16, 10, -0.088],
    [16, 11, 0.082],
    [16, 12, 0.032],
    [16, 13, 0.01],
    [16, 14, -0.01],
    [16, 15, -1],
    [16, 16, 1],
    [16, 17, 0.022],
    [16, 18, 0.009],
    [16, 19, -0.03],
    [17, 0, -0.021],
    [17, 1, 0.079],
    [17, 2, 0.023],
    [17, 3, 0.057],
    [17, 4, 0.048],
    [17, 5, -0.08],
    [17, 6, 0.08],
    [17, 7, 0.007],
    [17, 8, -0.007],
    [17, 9, 0.041],
    [17, 10, 0.044],
    [17, 11, -0.084],
    [17, 12, -0.004],
    [17, 13, -0.078],
    [17, 14, 0.078],
    [17, 15, -0.022],
    [17, 16, 0.022],
    [17, 17, 1],
    [17, 18, -0.502],
    [17, 19, -0.449],
    [18, 0, 0.036],
    [18, 1, 0.007],
    [18, 2, 0.006],
    [18, 3, -0.018],
    [18, 4, 0.045],
    [18, 5, 0.109],
    [18, 6, -0.109],
    [18, 7, -0.006],
    [18, 8, 0.006],
    [18, 9, 0.008],
    [18, 10, -0.004],
    [18, 11, 0.012],
    [18, 12, -0.012],
    [18, 13, 0.039],
    [18, 14, -0.039],
    [18, 15, -0.009],
    [18, 16, 0.009],
    [18, 17, -0.502],
    [18, 18, 1],
    [18, 19, -0.548],
    [19, 0, -0.017],
    [19, 1, -0.083],
    [19, 2, -0.028],
    [19, 3, -0.037],
    [19, 4, -0.093],
    [19, 5, -0.035],
    [19, 6, 0.035],
    [19, 7, -0.001],
    [19, 8, 0.001],
    [19, 9, -0.047],
    [19, 10, -0.038],
    [19, 11, 0.069],
    [19, 12, 0.017],
    [19, 13, 0.034],
    [19, 14, -0.034],
    [19, 15, 0.03],
    [19, 16, -0.03],
    [19, 17, -0.449],
    [19, 18, -0.548],
    [19, 19, 1],
  ];
  var option = {
    tooltip: {
      position: 'top'
    },
    xAxis: {
      type: 'category',
      data: name,
      splitArea: {
        show: true
      }
    },
    yAxis: {
      type: 'category',
      data: name,
      splitArea: {
        show: true
      }
    },
    visualMap: {
      min: 0,
      max: 1,
      calculable: true,
      orient: 'horizontal',
      left: 'center',
      bottom: '0%'
    },
    series: [
      {
        name: 'Punch Card',
        type: 'heatmap',
        data: data,
        label: {
          show: true
        },
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  };
  
  option && myChart.setOption(option);
  
    
    </script>
{% endblock %}